package pers.cnzdy.tutorial.Chapter8_Message_Service.Section4_AsyncTask;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ProgressBar;
import android.widget.TextView;

import pers.cnzdy.tutorial.R;
import pers.cnzdy.tutorial.Chapter8_Message_Service.Section4_AsyncTask.TimeConsumingTask;

public class AsyncTaskActivity extends AppCompatActivity {
    private TimeConsumingTask task;
    private ProgressBar pbBar;
    private TextView    txtView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_async_task);

        pbBar = (ProgressBar) findViewById(R.id.pb_async_task);
        txtView = (TextView) findViewById(R.id.txt_view_async_task);

        task = new TimeConsumingTask(this, pbBar, txtView);
        task.execute();
    }
}